var should = require('should');
var assert = require('assert');
var checkModel = require('../../app/models/checkModel');
var config = require('../config');

suite('测试', function () {
    setup(function (done) {
        checkModel.getByRoleId(config.other_role_id, function (err, model) {
            model.resetCheckInfo();
            model.getLastRefreshTime();
            model.addCheck(4, 1);
            model.toJSON();
            model.save(done);
        });
    });

    suite('sign', function () {
        test('补签次数统计', function (done) {
            checkModel.getByRoleId(config.role_id, function (err, check_model) {
                var total_check_day = check_model.getTotalCheckDay();
                if (total_check_day < 10) {
                    check_model.addCheck(2);
                    check_model.save();
                }
                var total_retry_check = check_model.getTotalRetryCheck();
                total_retry_check.should.above(0);
                done();
            });
        });
    });
});
